function fx = mdf(f,h)
    for k = 1:size(f,2)
        if k ~= 1 && k ~= size(f,2)
            fx(k) = (f(k+1)-f(k-1))/(2*h);
        else
            fx(k) = 0;
        end
    end
